package blog.service.impl;

import blog.mapper.CategoryMapper;
import blog.pojo.Category;
import blog.pojo.ResultVo;
import blog.service.CategoryService;
import org.apache.ibatis.annotations.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CategoryServiceImpl implements CategoryService{
    @Autowired
    private CategoryMapper categoryMapper;


    @Override
    public ResultVo selectCategoryList() {
	  List<Category> categoryList = categoryMapper.selectList(null);
	  if (categoryList!=null && categoryList.size()>0){
	      return new ResultVo(0,"success",categoryList);
	  }
	  return new ResultVo(100,"fail",null);
    }
}
